import React,{ Component } from "react"
import { View,Text,StyleSheet } from "react-native";

export default class Tabloid2 extends Component {
    constructor(props){
        super(props);
        this.state = {
            news:[
                {
                    title:"生态环境部“千里眼”执法效力初显 城市热点网 格无连续二次预警",
                    date:'2018-08-08',
                },
                {
                    title:"中央环保督察“回头看”将严查“一刀切”",
                    date:'2018-09-08',
                },
                {
                    title:"习近平抵达莫尔兹比港 开始对巴布亚新几内亚 进行国事访问",
                    date:'2018-10-08',
                },
            ],
        }
    }
    newsBroadcast(){  //新闻播报
        let Array = [];
        this.state.news.map((item,index,data)=>{
            let info = (
                <View key={index} style={{padding:18,borderBottomColor:'#e5e5e5',borderBottomWidth: 1,backgroundColor:'white',marginBottom: 5}}>
                    <Text style={{paddingTop:15,paddingBottom: 10,fontSize:15,fontWeight:'bold',}}>
                        {item.title}
                    </Text>
                    <Text style={{color:'#b1b1b1'}}>
                        发布时间: {item.date}
                    </Text>
                </View>
            );
            Array.push(info);
        });
        return Array;
    }
    render(){
        return (
            <View style={styles.container}>
                {  this.newsBroadcast() }
            </View>
        )
    }
}

const styles = StyleSheet.create({
   container:{
       flex:1,
   }
});